home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / drfrank.zip / DRFRANK.TXT < prev    next >
Text File  |  1992-01-16  |  34KB  |  791 lines

  1. |=============================================================================|
  2. |                Dr. Frank & Tools                                            |
  3. |=============================================================================|
  4. PREVIOUS USERS:  See the "What's New" and "DFA2" sections for a quick
  5. update on what's new and improved.
  6.  
  7. ******** Table of sections ********
  8. Quick Start (For those who can't stand to read the full documentation)
  9. Introduction  (What is Dr. Frank & Tools)
  10. What can Dr. Frank show you???
  11. Preparing your programs for Post-mortem debugging
  12. Running Dr. Frank
  13. Interpreting the results
  14. Post-processing the log file
  15. Logical Addresses
  16. DRFRANK
  17. BUILDSYM
  18. TMAPSYM
  19. EXEMAP
  20. DFA2
  21. EXETDS
  22. What's new
  23. Support
  24.  
  25. |=============================================================================|
  26. |    Quick Start ( For those who can't stand to read the full documentation   |
  27. |=============================================================================|
  28.  
  29. If you can't bear to read the full documentation, here's how to use Dr. Frank.
  30. It's assumed you know what you're doing here.  If these steps aren't clear,
  31. please read the actual documentation below.
  32.  
  33. 1) Make sure you have the correct TOOLHELP.DLL installed, and in your path.
  34. 2) Run Windows, and run DRFRANK.EXE.
  35. 3) Do whatever makes the UAE occur.
  36. 4) Look at the log file (DRFRANK.LOG in the windows directory).
  37. 5) Go to the directory where the log file is, and run:
  38.     "DFA2 DRFRANK.LOG DRFRANK.BIN"
  39. 6) Look at the DFA.OUT file.
  40. 7) Resolve to read the full documentation, because there's a lot you're missing.
  41.  
  42.  
  43. |=============================================================================|
  44. |                             Introduction                                    |
  45. |=============================================================================|
  46.  
  47. Dr. Frank (DRFRANK.EXE) is a program that will help you perform a post-mortem
  48. on your Unrecoverable Application Errors (UAE's) with Microsoft Windows.
  49. It is part of a suite of tools (described below) to assist programmers,
  50. and was written with the programmer in mind, rather then the non-programmer.
  51.  
  52. When an exception occurs, Dr. Frank will intercept it, and write a file
  53. (or 2) to your disk with information helpful to finding the cause of the
  54. exception. Since Dr. Frank is oriented towards developers, it writes out a
  55. short, concise report by default.  If however, you do want more information,
  56. there are several .INI file options which allow you to configure the
  57. report to your needs.
  58.  
  59. Dr. Frank is similar to DRWATSON, and uses the same TOOLHELP.DLL, which
  60. is currently in beta testing. TOOLHELP.DLL is shipped with BC++ 3.0, and
  61. is also available on Compuserve.  It can be found either with DRWTSN.ZIP
  62. or as TLLHLP.ZIP on WINADV.  The names and locations may move around, so
  63. your best bet is to search across all libraries for TOOLHELP or WATSON. 
  64. DRWATSON and TOOLHELP.DLL are Microsoft products.
  65.  
  66. There are many features that are not discussed in the general "how-to"
  67. sections of this file.  If you're so inclined, feel free to read the
  68. program reference sections to get a better idea of what Dr. Frank & Tools
  69. can do.
  70.  
  71. |=============================================================================|
  72. |                      What can Dr. Frank show you???                         |
  73. |=============================================================================|
  74.  
  75. The most important feature of Dr. Frank is it's ability to show you
  76. the "call stack". The call stack shows you what calls your program was
  77. executing when the exception occured.  Additionally, if you post-process
  78. the log file, you can obtain the names and values of your local and global
  79. variables (if you have TD debug information available).
  80.  
  81. To the CPU, the call stack is just a series of addresses.  However, with
  82. a little help from you, Dr. Frank can give you the names of the functions
  83. and procedures associated with the addresses, instead of just a series of
  84. addresses.  With this information, you can very quickly pinpoint where the
  85. program is blowing up.
  86.  
  87. Additionally, Dr. Frank can show you the CPU registers at the time of
  88. the exception, as well as a disassembly of the instruction that caused the
  89. exception.
  90.  
  91. Dr. Frank can also display information concerning the state of Windows
  92. when the exception occurred.  This includes things like available memory,
  93. which version of Windows, events in the programs message queue, etc...
  94.  
  95. |=============================================================================|
  96. |               Preparing your programs for Post mortem debugging             |
  97. |=============================================================================|
  98.  
  99. In order to get function names for the call stack, you need to provide
  100. symbolic information to Dr. Frank.  Dr. Frank can work without any
  101. symbolic information, but you'll find that having symbolic information
  102. greatly enhances your ability to pinpoint the problem.
  103.  
  104. There are 2 forms of symbolic information that Dr. Frank & Tools understand:
  105. 1) .SYM files.  These are used by Dr. Frank at the time of the exception.
  106. 2) Turbo Debugger debug information.  This is used after after the
  107.     exception occurs.
  108.  
  109. There are advantages to both:
  110.  
  111. - .SYM files are used directly by Dr. Frank when the exception occurs.
  112. Thus, there is no need to run another utility afterwards.
  113.  
  114. - .SYM files can be used by other programs, such as Dr. Watson, the Windows
  115. Debug Kernel, WDEB386, etc...
  116.  
  117. - Turbo Debugger debug information contains line number information.  In
  118. addition to giving you function/procedure names, it can also give you the
  119. source file and line number for call stack entries.  You will also be able
  120. to see the names and values of your programs variables.
  121.  
  122. - Turbo Debugger debug information can "find" static functions that .SYM
  123. files might not contain information for.
  124.  
  125. There are utilities in Dr. Frank to create and use both kinds of debug
  126. information.
  127.  
  128. ======== Creating .SYM files ========
  129.  
  130. - For your own programs, you first need to create a .MAP file, and
  131. then create a .SYM file from that.
  132.  
  133.     If you're using a Borland IDE, you should select the linker options
  134.     that produces a .MAP file.
  135.  
  136.     If you're letting BCC invoke TLINK, use the "-M" option on the BCC
  137.     command line.
  138.  
  139.     If you're invoking TLINK yourself, use the "/m" command line option,
  140.     and make sure that you're not using "/x" (no map file).
  141.  
  142.     If you're using TPCW, use the /GD command line switch.
  143.  
  144.     If you're using another compiler, do whatever is necessary to create
  145.     a .MAP file with Public symbols.
  146.  
  147.     Next, if your .MAP file is from a Borland product, use TMAPSYM to
  148.     create the .SYM file for it. For instance: "TMAPSYM mymodule.map" will
  149.     create MYMODULE.SYM in the current directory.
  150.  
  151.     If you're using another compiler, use MAPSYM, provided with the MS
  152.     SDK to create the .SYM file.
  153.  
  154.     If your using a makefile, you can add TMAPSYM as another rule command
  155.     after the link.
  156.  
  157. - For programs that you don't have source to, i.e., USER.EXE, GDI.EXE,
  158. you can still create .SYM files
  159.  
  160.     The easiest way to do this is to use BUILDSYM.  To do this, make
  161.     sure that the programs that come with Dr. Frank are somewhere
  162.     in your path.
  163.  
  164.     Next, go to the directory that contains the file(s) that you want
  165.     to create .SYM files for, i.e., "C:\WINDOWS\SYSTEM"
  166.  
  167.     Lastly, type "BUILDSYM", followed by the file specification that
  168.     you want to build .SYM files for.  For instance:
  169.     "BUILDSYM *.EXE" will create .SYM files for all the .EXE files in
  170.     the current directory.
  171.  
  172.     You'll probably want to build .SYM files in the WINDOWS directory,
  173.     as well as the SYSTEM subdirectory below it.  If you have the
  174.     SDK, you may wish to make sure you have backups of the SDK provided
  175.     .SYM files, although the .SYM files created by BUILDSYM are usually
  176.     superior to the SDK provided .SYM files.
  177.  
  178. Note:  The .SYM file must be in the same directory as the .EXE or
  179. .DLL that it corresponds to.
  180.  
  181. ======== Creating Turbo Debugger information ========
  182.  
  183. - For your own programs, you should have the compiler/linker produce
  184. debug information.
  185.  
  186.     If you're using a Borland IDE, make sure that the option to generate
  187.     debug info is on.
  188.  
  189.     If you're letting BCC invoke TLINK, specify the "-v" option in
  190.     the BCC command line.
  191.  
  192.     If you're invoking TLINK yourself, specify the /V option.
  193.  
  194.     If you're using TPCW, use the /V switch.
  195.  
  196.     If you're using a compiler that generates CodeView information, and
  197.     have a copy of Turbo Debugger that has TDCONVRT included, you may
  198.     be able to convert the CodeView information to TD information with it.
  199.  
  200. - For programs that you don't have source to, i.e., USER.EXE, GDI.EXE,
  201. you can still create TD debug information with EXETDS.
  202.  
  203.     Go to the directory that contains the file that you'll be creating
  204.     TD info for, i.e., "C:\WINDOWS\SYSTEM".
  205.  
  206.     Enter "EXETDS", followed by the filename, i.e., "EXETDS GDI.EXE"
  207.  
  208. Note:  The .TDS file must be in the same directory as the .EXE or
  209. .DLL that it corresponds to.
  210.  
  211. |=============================================================================|
  212. |                            Running Dr. Frank                                |
  213. |=============================================================================|
  214.  
  215. The easiest way to use Dr. Frank is to put it in the "load=" section
  216. of your WIN.INI.  Upon starting up, Dr. Frank will minimize itself.
  217. No additional interaction is required on your part.
  218.  
  219. When an exception occurs, Dr. Frank will write it's report out to a log file. 
  220. The default name for the file is "DRFRANK.LOG" in the Windows directory.
  221. Typically, this is "C:\WINDOWS\DRFRANK.LOG".  Next, you will see the
  222. "Unrecoverable Application Error" box.  Click on the "OK" button.  Next, you
  223. will see a dialog box from Dr. Frank that tells you what happened.
  224.  
  225. If you wish to stop Dr. Frank, you can select "close" from its system
  226. menu.
  227.  
  228. |=============================================================================|
  229. |                       Interpreting the log file                             |
  230. |=============================================================================|
  231.  
  232. Here is a sample Dr. Frank Failure report, followed by annotations enclosed
  233. in preceeded by []
  234.  
  235. --------
  236. Dr. Frank failure report - 11/20/1991  21:25:07
  237. Exception 13 at KERNEL 0001:6B35 (0105:6B35)  (TASK=ABC)
  238.  
  239. [] The first line contains the date and time that the exception occurred.
  240. []
  241. [] The next line tells you an exception 13 occurred in the KERNEL module,
  242. [] at logical address 0001:6B35.  The "(0105:6B35)" is the actual CS:IP
  243. [] of where the exception occured.  See the "Logical Address" section of
  244. [] this file if you're not familiar with the concept.  The task that was
  245. [] executing at the time was "ABC".
  246.  
  247. Disassembly:
  248. 0105:6B35  REPNE   SCASB
  249. 0105:6B37  MOV     AX,CX
  250. 0105:6B39  NEG     AX
  251. 0105:6B3B  DEC     AX
  252. 0105:6B3C  DEC     AX
  253.  
  254. [] The first instruction is the instruction that the CPU was attempting
  255. [] to excute when the exception occcured.
  256.  
  257. Stack Trace:
  258. 0  KERNEL    LSTRLEN + 000D
  259.    CS:IP 0001:6B35 (0105:6B35)   SS:BP 096D:1964
  260.    C:\WINDOWS\SYSTEM\KRNL386.EXE
  261.  
  262. 1  USER      USER.733 + 00E9
  263.    CS:IP 0029:0672 (05ED:0672)   SS:BP 096D:19D2
  264.    C:\WINDOWS\SYSTEM\USER.EXE
  265.  
  266. 2  USER      MESSAGEBOX + 008D
  267.    CS:IP 0001:9232 (04AD:9232)   SS:BP 096D:19F6
  268.    C:\WINDOWS\SYSTEM\USER.EXE
  269.  
  270. 3  ABC       function1(unsigned long,unsigned long,unsigned long) + 001B
  271.    CS:IP 0001:01DA (0965:01DA)   SS:BP 096D:1A0A
  272.    C:\DRFRANK\ABC.EXE
  273.  
  274. 4  ABC       WINMAIN + 008A
  275.    CS:IP 0001:02DC (0965:02DC)   SS:BP 096D:1A9C
  276.    C:\DRFRANK\ABC.EXE
  277.  
  278. 5  ABC       <no info>
  279.    CS:IP 0001:00B3 (0965:00B3)   SS:BP 096D:1AAA
  280.    C:\DRFRANK\ABC.EXE
  281.  
  282. [] The topmost entry is the function/proceedure that you were in when the
  283. [] exception/UAE occured.  In this case, the CS:IP was 0Dh bytes past the
  284. [] start of the LSTRLEN function in the KRNL386 module.
  285. []
  286. [] To read a stack trace,  start at the bottom, and work your way to the top.
  287. [] in this case:
  288. [] 
  289. [] Some unknown function in module ABC called WINMAIN.
  290. [] WINMAIN in module ABC called FUNCTION1 in module ABC
  291. [] FUNCTION1 in module ABC called MESSAGEBOX in module USER.
  292. [] MESSAGEBOX in module USER called the 733'rd entry point in module USER
  293. [] entry point 733 called LSTRLEN in module KERNEL.
  294. [] At that point, the exception 13 occured.
  295. []
  296. [] Note:  You'll only have function names if you have a .SYM file for
  297. [] that module.  If you have the SDK, you should have .SYM files for USER
  298. [] KRNLx86, and GDI.  If you don't, you can build them yourself with the
  299. [] BUILDSYM utility, described elsewhere.
  300.  
  301.  
  302. Registers:
  303. AX  0000
  304. BX  14DC
  305. CX  FFFF
  306. DX  0000
  307. SI  0002
  308. DI  0000
  309. SP  14DC
  310. BP  1542
  311. IP  6B35
  312. FL  0246
  313. CS  0105    Limit: 9A7F  execute/read
  314. DS  06E5    Limit: 4A9F  read/write
  315. ES  0000    Limit: 0000  NULL
  316. SS  0B9D    Limit: 269F  read/write
  317.  
  318. Message Queue:
  319. No messages retrieved yet
  320. Waiting in queue:
  321.   hWnd: 0000  msg: 1234  wParam: 0000  lParam: 00000001
  322.  
  323. [] If possible, Dr. Frank will tell you what the last message retrived
  324. [] from the message queue was, as well as tell you about any messages
  325. [] that were waiting to be prcessed.
  326.  
  327.  
  328. Heaps:
  329. USER  Max Size: F42F  Free CE92 (83%)
  330. GDI   Max Size: F79F  Free D73E (86%)
  331.  
  332. System info:
  333. Running in enhanced mode under Windows 3.0 debug version
  334. CPU: 80386
  335. Largest Free memory block: D80000 bytes
  336. Total linear memory space: f5f000 bytes
  337. Free linear memory space : d81000 bytes
  338. Swap file Pages: f5f (f5f000 bytes)
  339. --------
  340.  
  341. ======== Additional information:
  342. Note:  The function name given must be taken with a grain of salt.  Dr.
  343. Frank will look in the .SYM file for the closest symbol name that appears
  344. before the address in the call stack.  Some .SYM files do not contain
  345. information for all functions.  Thus, the function name appearing in the log
  346. file will be that of the closest function in the .SYM file thats address
  347. precedes the frame address.  If the offset field appears too high, be
  348. suspicious.
  349.  
  350. Note: What you see in the Message Queue display is not necessarily the last
  351. message the program received.  Windows may bypass the message queue, i.e.,
  352. SendMessage(), so keep that in mind when using this information.  Also, the
  353. message queue structure is not documented to my knowledge, so please let
  354. me know if you see something out of the ordinary.
  355.  
  356.  
  357. ======== Advance Features
  358. The optional Verbose Stack Trace section is for people who wish to see
  359. what was on the stack at the time of the exception.  For each stack frame
  360. that doesn't exceed 256 bytes, a hex dump is performed, starting at the
  361. SS:BP for that frame.  This data can be used to get the values of parameters
  362. that were passed to the function.  NOTE: It is usually easier to let DFA2
  363. do the hard work of figuring out what your paramters here.  However, there
  364. may be cases where you don't have TD debug information, so this feature
  365. remains.
  366.  
  367. Example:
  368.  
  369. MessageBox() takes 4 parameters, and is a FAR PASCAL function. On the stack,
  370. you will have:
  371.  
  372. [BP+0]   ; Previous BP, incremented by 1
  373. [BP+2]   ; Far return address
  374. [BP+6]   ; wType
  375. [BP+8]   ; lpCaption
  376. [BP+0C]  ; lpText
  377. [BP+10]  ; hWnd
  378.  
  379. Here's an example of a verbose stack trace entry:
  380. --------
  381. 2  USER      CS:IP 058D:9232  SS:BP 0BA5:15D4
  382.    MESSAGEBOX + 008D
  383.  
  384. 0000:   E9 15 85 01 8D 0B 00 00  96 09 E5 06 00 00 00 00
  385. 0010:   00 00 3E 02
  386. --------
  387. which you can read as:
  388. [BP+0]   -> 15E9        -> Previous BP, incremented by 1
  389. [BP+2]   -> 0B8D:0185   -> Far return address
  390. [BP+6]   -> 0           -> wType
  391. [BP+8]   -> 06E5:0996   -> lpCaption
  392. [BP+0C]  -> 0000:0000   -> lpText
  393. [BP+10]  -> 0           -> hWnd
  394.  
  395. |=============================================================================|
  396. |                    Post-processing the log file                             |
  397. |=============================================================================|
  398.  
  399. Although the Dr. Frank log file is oftentimes enough to help you locate the
  400. problem, you may also need the additional assistance of TD debug information.
  401.  
  402. To read and interpret the TD debug information at the time of the exception
  403. would cause potential system stability problems.  The system might crash before
  404. the information had been written to disk.  Therefore, the TD debug information
  405. is merged with the exception report after the exception has been cleared away,
  406. and the system is in a more stable state.
  407.  
  408. The post-processing utility for Dr. Frank is called DFA2.EXE (to distinguish it
  409. from an earlier, incompatible version called DFA.EXE).
  410.  
  411. By default, after a Dr. Frank has written out the log file, it writes a second
  412. file called DRFRANK.BIN.  This file will appear in the same directory as the
  413. log file.  It contains binary information about the task that was running, 
  414. including copies of the data segments at the time of the exception.
  415.  
  416. DFA2 will take the log file, and the DRFRANK.BIN file, and produce an output
  417. file that contains a stack trace, a listing of what selectors were in use
  418. by the failed task, and the names and values of your global variables.
  419.  
  420. To run DFA2, you simply specify the file names for it to process.  Typically,
  421. you will type the following:
  422.  
  423. DFA2 DRFRANK.LOG DRFRANK.BIN
  424.  
  425. The output is written to a file called DFA.OUT.  You do not have to specify
  426. the second file name, but you will only see the strack trace information in
  427. that case.
  428.  
  429. DFA2 has options not described here.  See the DFA2 section for more details.
  430.  
  431. Note:  There will only be 1 DRFRANK.BIN file written per windows session.  It
  432. is therefore important that you post-process the file as soon as possible after
  433. the exception.  In addition, it is a very good idea to either rename, or delete
  434. the log file after the post-processing.  DFA2 "associates" the first entry
  435. in the log file with the DRFRANK.BIN file.  If you have multiple entries in
  436. the log file, you may not get the results you expect.  To alleviate this
  437. problem as much as possible, I have changed Dr. Frank from previous versions.
  438. It will now default to overwriting any existing log file the first time an
  439. exception occurs in a given Windows sessions.  Subsequent exceptions in that
  440. session will be appended to the file.
  441.  
  442. |=============================================================================|
  443. |                          Logical Addresses                                  |
  444. |=============================================================================|
  445.  
  446. To understand a Dr. Frank log file, it is important to understand the
  447. difference between a "logical" segment, and a selector.
  448.  
  449. Windows .EXE files are called "New EXE" files, because they have a different
  450. format then traditional MS-DOS files.  When New EXE files are linked, each
  451. segment is placed in a different section of the file.  At the same time,
  452. a segment table is created, which allows Windows and other programs to
  453. quickly find the data for a particular segment.  When referring to a
  454. particular segment, its position in the segment table is used.  Thus,
  455. the first segment in the table is logical segment 1, the second is logical
  456. segment 2, etc...  You can determine the number of segments, their size,
  457. and other information by running TDUMP (A Turbo Debugger utility) on
  458. the file.  Alternatively, if you generate a .MAP file for your program,
  459. you can obtain the same information.
  460.  
  461. When the program is loaded, Windows allocates space for each logical segment
  462. and assigns it a unique selector.  The code for the logical segments is then
  463. read into memory, using the assigned selector.
  464.  
  465. Note:  For any given .EXE or .DLL, the logical segment that a procedure
  466. or function is in will never change.  The selector value on the other
  467. hand, depends upon what selector Windows decided to allocate for the
  468. particular logical segment.  In other words, the selector Windows uses
  469. for a particualar logical segment can change between different invocations
  470. of the .EXE or .DLL.
  471.  
  472. A logical address is comprised of a module name, a logical segment, and
  473. an offset.  For instance "USER 0001:65EA" means offset 65EA in the
  474. first segment of USER.EXE.  Logical addresses are what is used in
  475. the Publics section of a .MAP file.
  476.  
  477. A physical address is comprised of a selector and an offset.  A typical
  478. physical address that windows might create would be 09CD:65EA.  Physical
  479. addresses are what the CPU works with.
  480.  
  481. In the log file, addresses are given in terms of the the logical
  482. addresses as well as physical address  The logical address appears first,
  483. followed by the physical address in ()'s.
  484.  
  485.  
  486. |=============================================================================|
  487. |                              DRFRANK                                        |
  488. |=============================================================================|
  489.  
  490. Since exception can not occur in real mode, Dr. Frank will only run if
  491. used in Windows Standand and Enhanced modes.
  492.  
  493. Options for Dr. Frank are specified in the WIN.INI file as follows:
  494.  
  495. LogDir=[directory to put log file].
  496.     This defaults to the Windows directory if none is specified.
  497.  
  498. LogFileName=[file name to put log file]
  499.     There should not be any path information in this string.  If you
  500.     need to specify a log file directory, use the LogDir option.
  501.     If LogFileName is not specified, DRFRANK.LOG is used.
  502.  
  503. NewLog=0/1
  504.     Specifying 0 will cause Dr. Frank to always append reports to the
  505.     previous log file.  Specifying 1 will cause Dr. Frank to
  506.     overwrite the previous .LOG file the first time an exception occurs.
  507.     Subsequent exceptions that occur during the same Windows session
  508.     will be appended to the .LOG file. The default is 1, or always create
  509.     a new logfile when the first exception occurs.
  510.  
  511. ShowSystemInfo=0/1
  512.     Specifying 1 will cause Dr. Frank to output the Task list, the
  513.     Module list, and information about the USER & GDI heaps.  This
  514.     information is omitted from the report if 0 is specified.
  515.     ShowSystemInfo=0 is the default.
  516.  
  517. StackData=0/1
  518.     Specifying 1 will cause Dr. Frank to add a verbose stack trace
  519.     display to the end of the log file.  Each entry displays the
  520.     memory at a positive offset from the SS:BP for that stack frame.  If
  521.     there are > 256 bytes between 2 successive stack frames, the memory
  522.     display is omitted for that frame.  Specifying 0 for the StackData
  523.     will cause the verbose stack trace to not be generated.  This is the
  524.     default.
  525.  
  526. AuxOut=0/1
  527.     Specifying 1 will cause Dr. Frank to write an abbreviated form of
  528.     it's report to AUX when writing the .LOG file.  To use this, you
  529.     should have either be using a device driver that redirects AUX to
  530.     a second monitor, or a terminal connected to STDAUX.  The defualt
  531.     is 0, or no output to AUX.
  532.  
  533. Here is an example of my entry in the WIN.INI file:
  534.  
  535. [DrFrank]
  536. logdir=C:\DRFRANK
  537. NewLog=1
  538. StackData=1
  539. ShowSystemInfo=0
  540. AuxOut=1
  541.  
  542. |=============================================================================|
  543. |                             BUILDSYM                                        |
  544. |=============================================================================|
  545.  
  546. BUILDSYM.EXE was written to allow you to automate the process of building
  547. .SYM files.
  548.  
  549. For instance, you may not have Microsoft Windows Software Development Kit.
  550. Thus, you do not have .SYM files for the Windows DLLs such as USER, GDI,
  551. KRNL286, and KRNL386.  Or, you may have the SDK, but want the undocumented
  552. entry points to be included in your .SYM files.
  553.  
  554. You could manually go in and EXEMAP each file, then TMAPSYM the .MAP file,
  555. and then delete the .MAP file.  What a drudge...
  556.  
  557. BUILDSYM will do all of that for you, and do it on multiple files.
  558.  
  559. BUILDSYM has 1 command line argument, which is a filespec that can include
  560. wildcards.
  561.  
  562. For instance, "BUILDSYM C:\WINDOWS\SYSTEM\*.*" will build .SYM files for
  563. all Windows EXE's, DLL's, DRV's, etc... in that directory.
  564.  
  565. Before attempting to build .SYM files, BUILDSYM will first determine if
  566. the file is a valid New EXE file.  If not, it does not EXEMAP/TMAPSYM it.
  567. Thus, you should not be concerned about using *.* as a filespec, although
  568. it might take a bit longer then if you used a more restrictive filespec.
  569.  
  570. Note:  Any .SYM files created will be placed in the current directory.
  571. Thus, you should be in the directory where you want to create .SYM files.
  572. In order for Dr. Frank and other utilities to find the .SYM files, they
  573. need to be in the same directory as the New EXE file.
  574.  
  575. Note: TMAPSYM will overwrite any existing .SYM files with the same name.
  576. Thus, make sure you have backups of any existing .SYM files before using
  577. BUILDSYM or TMAPSYM.
  578.  
  579. |=============================================================================|
  580. |                               TMAPSYM                                       |
  581. |=============================================================================|
  582.  
  583. TMAPSYM.EXE was written to create .SYM files from any BC++ or TPW created
  584. .MAP files.
  585.  
  586. Other .MAP to .SYM file converters may not work properly with Borland .MAP
  587. files.  For instance, C++ programs have both the function name, as well
  588. as it's argument list to the .MAP file.  TMAPSYM properly handles this.
  589.  
  590. TMAPSYM has one command line option, namely the name of the .MAP file to
  591. be processed.
  592.  
  593. For instance:  TMAPSYM mytest.map
  594.  
  595. This will create a file called MYTEST.SYM in the current directory.
  596.  
  597. It is generally faster to have TLINK generate a link map, and use
  598. TMAPSYM, then it is to use DFA.  Also, by using TMAPSYM, you get
  599. an immediate symbolic stack trace, as opposed to having to manually
  600. run DFA after an exception occurs.
  601.  
  602. Note:  If you are using precompiled headers with BC++, the default extension
  603. of the precompiled headers file is .SYM.  If you use TMAPSYM, you might
  604. inadvertantly overwrite the .SYM file from the compiler.  Since other
  605. utilities, as well as the Windows debugging version will only look for
  606. .SYM files, I would recommend using the -H=filename option with BC++ to
  607. name the precompiled headers file to a non-conflicting name.
  608.  
  609. One caveat when using TMAPSYM is that it will only be able to find
  610. functions that are in the entry table of the executable.  Thus, public
  611. functions that are not exported will not be found.  In general this is
  612. not a problem.
  613.  
  614. |=============================================================================|
  615. |                               EXEMAP                                        |
  616. |=============================================================================|
  617.  
  618. EXEMAP was written to create .MAP files from New EXE file format files
  619. (.EXE, .DLL, .DRV, etc...) for which you do not have source code or
  620. a .MAP file for.
  621.  
  622. .MAP files created from EXEMAP can be processed by TMAPSYM to create .SYM
  623. files.  These .SYM files are then in turn used by Dr. Frank
  624.  
  625. One particularly good use of EXEMAP is to create .MAP files for DLL's
  626. when a .SYM file is not provided.
  627.  
  628. Another reason why EXEMAP was written is because many .SYM files are
  629. incomplete.  Oftentimes undocumented functions do not appear in the .SYM
  630. files.  Since EXEMAP works directly from the executable file, many
  631. additional function entry points can be found, and included in your .SYM
  632. files.
  633.  
  634. The syntax for EXEMAP is:
  635.  
  636. EXEMAP <executable filename> [output file name]
  637.  
  638. The default output filename, if none is supplied, is the input filename,
  639. with a .MAP extension.
  640.  
  641. |=============================================================================|
  642. |                                 DFA2                                        |
  643. |=============================================================================|
  644.  
  645. DFA.EXE (Dr. Frank Assistant) was written to allow symbolic stack traces
  646. and variable values to be obtained via Turbo Debugger symbol tables. DFA2 will
  647. give you a file that contains a stack trace similar to the one in the Dr. Frank
  648. log file, but with but with the addition of function names and line numbers,
  649. as well as local and global variables.
  650.  
  651. Note:  DFA2 will not work with log files from previous versions of Dr. Frank.
  652. You must use the new DRFANK.EXE with DFA2.
  653.  
  654. The syntax for DFA2 is:
  655.  
  656. DFA2 [options] <Dr. Frank .LOG file> [DRFRANK.BIN]
  657.  
  658. Options:
  659.     /O<output filename>.  i.e., /Ogoober will send the output to "goober"
  660.     /D  - Forces DFA2 to write out a hex dump of the saved data segments
  661.  
  662. You do not need to specify the DRFRANK.BIN file, but if you don't, the
  663. resulting output file will not contain the program variable information.
  664.  
  665. NOTE:  DFA2 takes the first entry in the Dr. Frank log file, and assumes
  666. that it corresponds to the data in the DRFRANK.BIN file.  Also, you will
  667. only get 1 DRFRANK.BIN file per Window sessions.  The upshot is that it's a
  668. good idea to post-process immediately after the exception occurs, and
  669. copy/rename the files if you wish to save the information.
  670.  
  671. ======== How does DFA2 look for TD debug information?
  672.  
  673. First, the filename that is specified in the log file is inspected
  674. for TD debug information.  If none is found, the file extension is changed
  675. to .TDS.
  676.  
  677. ======== Format of the DFA.OUT file
  678. If you have to ask...  Seriously, it's pretty self explanatory.  If you see
  679. something wrong, let me know.
  680.  
  681. |=============================================================================|
  682. |                                EXETDS                                       |
  683. |=============================================================================|
  684.  
  685. EXETDS (EXE to TDS) was written to allow you to create Turbo Debugger
  686. symbol files (.TDS) from the information contained in the exports of
  687. an EXE or DLL file.  DFA can use these files when processing a log file.
  688. Also, TDW (Turbo Debugger for Windows) can use these files to provide
  689. symbolic disassembly in the CPU window.
  690.  
  691. The syntax for EXETDS is:
  692.  
  693. EXETDS <executable filename> [output file name]
  694.  
  695. The default output filename, if none is supplied, is the input filename,
  696. with a .TDS extension.
  697.  
  698. ---- For Advanced users
  699. To see the symbolic disassembly in TDW, you need to go to the
  700. VIEW | MODULES dialog box, select the appropriate module name in the
  701. right-hand pane, and then select "Load symbol table".
  702.  
  703. To posistion to the start of a function, you can either "GOTO" from the CPU
  704. disassembly pane, or select VIEW | VARIABLES.  You should see a list of
  705. all the functions for the module.  You should then be able to select one,
  706. and have the disassembly pane be updated to the start of the function.
  707.  
  708. Note:
  709. For some reason, TDW will hang if you try to load a symbol table for
  710. KRNL386.EXE.  KRNL286.EXE, and the other Windows files seem to work
  711. correctly.
  712.  
  713.  
  714. |=============================================================================|
  715. |                               What's New                                    |
  716. |=============================================================================|
  717. --- ???
  718. The post-processing program DFA.EXE has been replaced by DFA2.EXE.  DFA2 gives
  719. you all the information DFA gave you, but adds the ability to display the
  720. values of your local and global variables.  Hard Work!!!  See DFA2 section
  721. for more info.
  722.  
  723. DFA2 is not backwards compatible, so you must use the new DRFRANK.EXE.
  724.  
  725. The format of the stack trace has changed in the DRFRANK.LOG file.
  726.  
  727. Dr. Frank now defaults to always creating a new LOG file the first time
  728. an exception occurs in the Windows session.
  729.  
  730. The ability to disable the display of the filename in the stack trace has
  731. been removed.
  732.  
  733. --- 11/21/91
  734. DFA now outputs the original line, as output in the log file, if there
  735. is no TD debug info for that entry.
  736.  
  737. DFA will now process all of the stack trace sections in a log file,
  738. instead of just the first one.
  739.  
  740. EXETDS is new for this release.
  741.  
  742. --- 10/27/91 ---
  743. Dr. Frank now has displays for System information (Task list, Module list,
  744. Memory usage), and the Message queue.  In addition, the "Exception XX in
  745. XXXXXXX" dialog now comes up after the UAE box.  This seems to make it
  746. more robust in a few oddball situations.
  747.  
  748. DFA now should handle larger symbol tables, and should handle BC++ static
  749. functions and functions in TPU's.
  750.  
  751. EXEMAP now outputs the program entry point, and will abort gracefully if
  752. there are no segments in the New EXE file, i.e., .FON files.  Also, symbol
  753. names up to 255 characters should be O.K.
  754.  
  755. TMAPSYM will now process the program entry point from the .MAP file.
  756. Symbol names up to 255 characters should be O.K.
  757.  
  758. BUILDSYM is new for this release.
  759.  
  760. |=============================================================================|
  761. |                 Support for Dr. Frank and Tools                             |
  762. |=============================================================================|
  763.  
  764. Dr. Frank is Freeware for the time being.  All I ask is that you let me know
  765. what you think, and if you have suggestions, or think you have a bug, to let
  766. me know.
  767.  
  768. My Compuserve ID is: 76117,1720
  769.  
  770. Also, my main hangouts on Compuserve are BPROGB, sections 3 & 8 (Debugger/
  771. Profiler, Windows Programming), and WINSDK.
  772.  
  773. Matt Pietrek
  774.  
  775. ===== Legal Disclaimer ===
  776.  
  777. Windows, MS-DOS, DRWATSON, WDEB386, and TOOLHELP.DLL are trademarks of
  778. Microsoft Inc.
  779.  
  780. Turbo Debugger, Borland C++, Turbo Pascal for Windows, TLINK and TDUMP are
  781. trademarks of Borland International.
  782.  
  783. All other names are trademarks of their respective holders.
  784.  
  785. I make no claims as to the usability of these programs, and am not
  786. liable for any damages, incidental or consequential arising out of
  787. the use of these programs.
  788.  
  789. IANAL, so I hope I got this right...
  790.  
  791.